package com.thwcompany.rabbitMQ.listener;

import com.thwcompany.pojo.Mail;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
@SuppressWarnings("all")
public class FanoutListener1 {
	//发布-订阅模式，这里配置消费者1号监听消息队列fanoutqueue1
	@RabbitListener(queues = "fanoutqueue1")
	public void subscribe(Mail mail) throws IOException {
		System.out.println("fanout消费者1号，从fanoutqueue1消息队列监听到的消息是："+mail.toString());
	}
}
